package com.hejing.迭代器的使用与增强for循环;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Collection;

/**
 * ClassName: ForeachTest
 * Package: com.hejing.迭代器的使用与增强for循环
 * Description:
 *
 * @Author: HeJing
 * @Create: 2023-05-02 19:31
 * @Version: 1.0
 */
public class ForeachTest {
    @Test
    public void test01(){

        String[] arr = new String[] {"aa", "bb", "cc", "dd"};
        Collection coll = new ArrayList();
        coll.add("AA");
        coll.add("BB");
        coll.add("CC");
        coll.add(true);
        coll.add(new Person("赵雷", 32));

        for(Object obj : arr) {
            System.out.println(obj);
        }

    }
}




































